﻿@{
    ViewBag.Title = "授权管理";
}
@section headerSection{
    <style>
        #exampleToolbar > .form-group {
            float: left;
            margin: 0;
            margin-left: 5px;
        }
    </style>
}
<div class="animated fadeInRight">
    <!-- Panel Other -->
    <div class="ibox float-e-margins" style="margin-bottom: 0px;">
        <div class="ibox-content" style="padding: 5px 20px 0px 20px;">
            <div class="row row-lg">
                <div class="col-sm-12 col-sm-leftRight">
                    <!-- Example Toolbar -->
                    <div class="example">
                        <div class="btn-group hidden-xs" id="exampleToolbar" role="group">
                            @{
                                List<string> folderList = (List<string>)ViewBag.elementList;
                                if (folderList.Contains("powerDetail"))
                                {
                                    <button id="powerDetail" type="button" class="btn btn-outline btn-primary">
                                        <i class="glyphicon glyphicon-th-large" aria-hidden="true">详细</i>
                                    </button>
                                }
                                if (folderList.Contains("powerAdd"))
                                {
                                    <button id="powerAdd" type="button" class="btn btn-outline btn-primary">
                                        <i class="glyphicon glyphicon-plus" aria-hidden="true">授权</i>
                                    </button>
                                }
                                if (folderList.Contains("powerEdit"))
                                {
                                    <button id="powerEdit" type="button" class="btn btn-outline btn-primary">
                                        <i class="glyphicon glyphicon-pencil" aria-hidden="true">编辑</i>
                                    </button>
                                }
                                if (folderList.Contains("powerDel"))
                                {
                                    <button id="powerDel" type="button" class="btn btn-outline btn-danger">
                                        <i class="glyphicon glyphicon-trash" aria-hidden="true">删除</i>
                                    </button>
                                }
                                if (folderList.Contains("powerImport"))
                                {
                                    <button id="powerImport" type="button" class="btn btn-outline btn-primary">
                                        <i class="glyphicon glyphicon-pencil" aria-hidden="true">批量导入</i>
                                    </button>
                                }
                                if (folderList.Contains("btnSearch"))
                                {
                                    <div class="form-group">
                                        <input id="powerName" name="powerName" type="text" class="form-control" placeholder="请输入用户名/登录名">
                                    </div>
                                    <div class="form-group">
                                        <input id="startDate" name="startDate" type="text" class="laydate-icon form-control input-sm" placeholder="开始日期" title="开始日期" onclick="laydate({istime: true, format: 'YYYY-MM-DD'})" />
                                    </div>
                                    <div class="form-group">
                                        <input id="endDate" name="endDate" type="text" class="laydate-icon form-control input-sm" placeholder="结束日期" title="结束日期" onclick="laydate({istime: true, format: 'YYYY-MM-DD'})" />
                                    </div>
                                    <div class="form-group" style="margin-top:-2px;">
                                        <select id="powerStatus" name="powerStatus" title="请选择状态" class="form-control show-tick selectpicker" placeholder="请选择状态">
                                            <option value="-1" selected>全部</option>
                                            <option value="0">未生效</option>
                                            <option value="1">正常</option>
                                            <option value="2">10天内到期</option>
                                            <option value="3">封停</option>
                                            <option value="4">逾期</option>
                                        </select>
                                    </div>
                                    <div class="form-group">
                                        <button id="btnSearch" class="btn btn-primary" type="button"><i class="fa fa-search"></i>&nbsp;查询</button>
                                    </div>
                                }
                            }
                        </div>
                        <table id="exampleTableToolbar" data-mobile-responsive="true" data-radio="true"></table>
                    </div>
                    <!-- End Example Toolbar -->
                </div>
            </div>
        </div>
    </div>
    <!-- End Panel Other -->
</div>
<!-- 添加/编辑 -->
<div id="powerForm" style="width: 500px; overflow: hidden; display: none;">
    <form class="form-horizontal m-t" id="powerFormTable" method="post">
        <div class="form-group">
            <label class="col-sm-4 control-label">用户登录名<span class="glyphicon glyphicon-asterisk requiredtitle"></span>：</label>
            <div class="col-sm-7">
                <input id="login_name" name="login_name" type="text" class="form-control input-sm" placeholder="请输入用户登录名" title="请输入用户登录名" required="" aria-required="true" />
                <input type="hidden" id="id" name="id" />
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-4 control-label">编号<span class="glyphicon glyphicon-asterisk requiredtitle"></span>：</label>
            <div class="col-sm-7">
                <input id="num_code" name="num_code" type="text" class="form-control input-sm" placeholder="请输入编号" title="请输入编号" required="" aria-required="true" />
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-4 control-label">状态<span class="glyphicon glyphicon-asterisk requiredtitle"></span>：</label>
            <div class="col-sm-7">
                <select id="status" name="status" title="请选择状态" data-live-search="true" class="form-control show-tick selectpicker" placeholder="请选择状态">
                    <option value="0">未生效</option>
                    <option value="1" selected>正常</option>
                    <option value="3">封停</option>
                    @*<option value="2">10天内到期</option>                    
                    <option value="4">逾期</option>*@
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-4 control-label">开始时间<span class="glyphicon glyphicon-asterisk requiredtitle"></span>：</label>
            <div class="col-sm-7">
                <input id="start_date" name="start_date" type="text" class="laydate-icon form-control input-sm" required="" aria-required="true" placeholder="开始日期" title="开始日期" onclick="laydate({ istime: true, format: 'YYYY-MM-DD hh:mm:ss' })" />
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-4 control-label">结束时间<span class="glyphicon glyphicon-asterisk requiredtitle"></span>：</label>
            <div class="col-sm-7">
                <input id="end_date" name="end_date" type="text" class="laydate-icon form-control input-sm" required="" aria-required="true" placeholder="结束时间" title="结束时间" onclick="laydate({ istime: true, format: 'YYYY-MM-DD hh:mm:ss' })" />
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-4 control-label">机器码：</label>
            <div class="col-sm-7">
                <input id="machine_code" name="machine_code" type="text" class="form-control input-sm" placeholder="请输入机器码" title="请输入机器码" />
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-4 control-label">机器名：</label>
            <div class="col-sm-7">
                <input id="machine_name" name="machine_name" type="text" class="form-control input-sm" placeholder="请输入机器名" title="请输入机器名" />
            </div>
        </div>
        <div class="form-group" id="autoBatch">
            <label class="col-sm-4 control-label">批量添加条数：</label>
            <div class="col-sm-7">
                <input id="auto_num" name="auto_num" type="text" class="form-control input-sm" value="1" placeholder="请输入批量条数" title="请输入批量条数" />
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-4 control-label">备注：</label>
            <div class="col-sm-7">
                <textarea class="form-control" id="doc_note" name="doc_note" rows="3" placeholder="请输入备注信息" title="请输入备注信息"></textarea>
            </div>
        </div>
    </form>
</div>
<!-- Excel 导入授权用户 -->
<div id="import_form" style="width: 460px;height:100%; overflow: hidden; display: none;">
    <form class="form-horizontal m-t" id="importFormTable" enctype="multipart/form-data">
        <div class="form-group">
            <label class="col-sm-3 control-label">授权文件<span class="glyphicon glyphicon-asterisk requiredtitle"></span>：</label>
            <div class="col-sm-8">
                <input id="excelFile" name="excelFile" type="file" accept=".xlsx" fileId="BusinessLicenseImg" attribute="src" class="form-control input-sm files" placeholder="请选择导入文件上传">
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-10 col-sm-offset-3">
                <a class="btn btn-primary btn-sm" href="~/Resources/excel/授权导入模板.xlsx">
                    <span class="glyphicon glyphicon-download"></span>
                    下载excel模板
                </a>
            </div>
        </div>
    </form>
</div>
@section footSection{
    <script src="~/Resources/mainFrame/js/plugins/prettyfile/bootstrap-prettyfile.js"></script>
    <script src="~/Resources/myScript/Doc/powerManager.js"></script>
    <script>
        $(function () {
            powerManager.initPage();
        });
    </script>
}

